package com.cskaoyan.controller;

import com.cskaoyan.bean.BO.BasePageInfoBo;
import com.cskaoyan.bean.PO.MarketUser;
import com.cskaoyan.bean.VO.WxFootPrintVo;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.service.WxFootPrintService;
import com.fasterxml.jackson.core.sym.NameN;
import com.fasterxml.jackson.databind.ser.Serializers;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author linhanxin
 * @date 2022/8/17.
 */
@RestController
@RequestMapping("wx/footprint")
public class WxFootPrintController {
    @Autowired
    WxFootPrintService wxFootPrintService;
    @RequestMapping("list")
    public BaseRespVo footPrintList(BasePageInfoBo basePageInfoBo){
        Session session = SecurityUtils.getSubject().getSession();
        Integer userId = (Integer) session.getAttribute("userId");
        CommonData<WxFootPrintVo> commonDataVo = wxFootPrintService.footPrintList(basePageInfoBo,userId);
        return BaseRespVo.ok(commonDataVo);
    }

    @RequestMapping("delete")
    public BaseRespVo deleteFootprint(Integer id){
        wxFootPrintService.deleteFootPrint(id);
        return BaseRespVo.ok(0, null,"成功");
    }
}
